<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Customer extends CI_Controller {

	function __construct()
	{
		parent::__construct();
		$this->load->database();
		$this->load->model('admin/customer_m');
	}
	
	public function index(){
		$this->load->library('form_validation');
		
		$this->load->view('admin/common/header');
		$this->load->view('admin/customer/customer_list', array('list'=>array()));
		$this->load->view('admin/common/footer');
	}
	
	public function search(){
		
		$param = array();
		$param["s_customercode_from"] = $this->input->post('s_customercode_from');
		$param["s_customercode_to"] = $this->input->post('s_customercode_to');
		$param["s_customercode_name"] = $this->input->post('s_customercode_name');
		$param["s_customercode_name_kana"] = $this->input->post('s_customercode_name_kana');
		$param["s_tel_no"] = $this->input->post('s_tel_no');
		$param["s_mail_address"] = $this->input->post('s_mail_address');

		$list = $this->customer_m->get_customer_lists($param);
		
		
		$this->load->library('form_validation');
// 		$this->form_validation->set_rules('s_commoditycode_from', '제목', 'required');
// 		$this->form_validation->run();
		
		
		$this->load->view('admin/common/header');
		$this->load->view('admin/customer/customer_list', array('list'=>$list));
		$this->load->view('admin/common/footer');
	}
	
	public function detail($customer_code){
		$this->load->view('admin/common/header');
		$detail = $this->commodity_model->search_detail($sku_code);
		$this->load->view('admin/customer/detail', array('detail'=>$detail));		
		$this->load->view('admin/common/footer');
	}
	
}

